home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / ATM_EXAM / ATM_RAND / BBOX.H < prev    next >
Text File  |  1990-01-11  |  2KB  |  115 lines

  1. /* bBox.h version 2.0 */
  2.  
  3. #ifndef _ATMStrike
  4. #define _ATMStrike
  5.  
  6. #include "ATMTypes.h"
  7. #include <FontMgr.h>
  8.  
  9. int boxFondATMStrike(FamRec **, fixedBoxATM *, fixed *);
  10. int expandATMStrike(FontRec **, intBoxATM *, int, int, int);
  11.  
  12. #endif
  13.  
  14. #include "ATMTypes.c"          /* b box stuff           */
  15. #include <color.h>
  16. #include <math.h>
  17. #include <stdlib.h>       /* atoi   */
  18. #include <stdio.h>        /* sscanf */
  19. #include <quickDraw.h>
  20.  
  21. #define bBoxMenu        4  /* explicit MyMenus[] array index */
  22. #define    pointSizeDLOG    1000
  23. #define bBoxResultDLOG    137
  24.  
  25. /* Dialog field ids */
  26. #define sizeField        4
  27. #define boldStyle        5
  28. #define italicStyle        6
  29. #define outlineStyle    7
  30. #define shadowStyle        8
  31.  
  32.  
  33. #define    boldurxDelta    0.027        /* deltas for variations of styles - from Tech Tips doc */
  34. #define    boldllyDelta    0.013
  35. #define    shadowurxDelta    0.078125    /* 20/256    */
  36. #define shadowllyDelta    0.046875    /* 12/256    */
  37. #define italicMultiplier 0.175
  38.  
  39. float    DoPointSizeDialog(void);
  40. void    DoBBoxResultDialog(int16,float);
  41. void    UpdateStyles(DialogPtr theDialog,int16 action,int16 setThisOff);
  42.  
  43. typedef struct
  44.     {
  45.     int size;
  46.     int style;
  47.     int id;
  48.     } FontAssocEntry;
  49.  
  50. typedef struct
  51.     {
  52.     int length;
  53.     FontAssocEntry entry[1];
  54.     } FontAssocTable;
  55.  
  56. typedef struct
  57.     {
  58.     int length;
  59.     long offset[1];
  60.     } FontOffsetTable;
  61.  
  62. typedef struct
  63.     {
  64.     int style;
  65.     fixed12 xl;
  66.     fixed12 yl;
  67.     fixed12 xg;
  68.     fixed12 yg;
  69.     } FontBoxEntry;
  70.  
  71. typedef struct
  72.     {
  73.     int length;
  74.     FontBoxEntry entry[1];
  75.     } FontBoxTable;
  76.  
  77. typedef struct
  78.     {
  79.     int class;
  80.     long offset;
  81.     long reserved;
  82.     unsigned char suffix[48];
  83.     } FontStyleTable;
  84.  
  85. typedef struct
  86.     {
  87.     int style;
  88.     int widths[1];
  89.     } FontWidthEntry;
  90.  
  91. typedef struct
  92.     {
  93.     int length;
  94.     FontWidthEntry entry[1];
  95.     } FontWidthTable;
  96.  
  97. struct styleDeltas
  98. {
  99.   float llx; 
  100.   float lly; 
  101.   float urx;
  102.   float ury;
  103.   int    italicFlag;
  104.   int    outlineFlag;
  105. };
  106.  
  107. /******* GLOBALS ***********/
  108.  
  109. static struct styleDeltas styleData;
  110.  
  111. static int16    bBoxitem = 1; 
  112. static char     bBoxName[256];
  113. static int16    sizeitem = 1;
  114. static char     sizeName[256];
  115.